From c100ebd2dafcd88dead1b12f3b8c10391dc0f1af Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 11 Nov 2005 22:29:09 +0000 Subject: [PATCH] Do not check whether the path is a folder. It is useful to bookmark files 2005-11-11 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Do not check whether the path is a folder. It is useful to bookmark files as well (e.g. todo.txt), and this will also help performance. (shortcuts_add_bookmark_from_path): Likewise. (shortcuts_activate_iter): Change folders or select files, as appropriate. --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ gtk/gtkfilechooserdefault.c | 19 ++++--------------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1c06416f0..34f7f4d15c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-11-11 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Do not + check whether the path is a folder. It is useful to bookmark + files as well (e.g. todo.txt), and this will also help + performance. + (shortcuts_add_bookmark_from_path): Likewise. + (shortcuts_activate_iter): Change folders or select files, as + appropriate. + 2005-11-11 Federico Mena Quintero * tests/autotestfilechooser.c (main): Use diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c1c06416f0..34f7f4d15c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2005-11-11 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Do not + check whether the path is a folder. It is useful to bookmark + files as well (e.g. todo.txt), and this will also help + performance. + (shortcuts_add_bookmark_from_path): Likewise. + (shortcuts_activate_iter): Change folders or select files, as + appropriate. + 2005-11-11 Federico Mena Quintero * tests/autotestfilechooser.c (main): Use diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 998a6eb99b..0fcf7967dc 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -1275,12 +1275,6 @@ shortcuts_insert_path (GtkFileChooserDefault *impl, } else { - if (!check_is_folder (impl->file_system, path, error)) - { - profile_end ("end - is not folder", NULL); - return FALSE; - } - if (label) label_copy = g_strdup (label); else @@ -2035,14 +2029,6 @@ shortcuts_add_bookmark_from_path (GtkFileChooserDefault *impl, if (shortcut_find_position (impl, path) != -1) return FALSE; - /* FIXME: this check really belongs in gtk_file_system_insert_bookmark. */ - error = NULL; - if (!check_is_folder (impl->file_system, path, &error)) - { - error_adding_bookmark_dialog (impl, path, error); - return FALSE; - } - error = NULL; if (!gtk_file_system_insert_bookmark (impl->file_system, path, pos, &error)) { @@ -6759,7 +6745,10 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl, const GtkFilePath *file_path; file_path = col_data; - change_folder_and_display_error (impl, file_path); + if (check_is_folder (impl->file_system, file_path, NULL)) + change_folder_and_display_error (impl, file_path); + else + gtk_file_chooser_default_select_path (GTK_FILE_CHOOSER (impl), file_path, NULL); } } -- 2.30.2